﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using Digitalmes.Model.IoTManagement;
using Digitalmes.Model;

namespace Digitalmes.ViewModel.IoTManagement.CollectTaskVMs
{
    public partial class CollectTaskTemplateVM : BaseTemplateVM
    {
        
        [Display(Name = "_Model._CollectTask._TaskName")]
        public ExcelPropety TaskName_Excel = ExcelPropety.CreateProperty<CollectTask>(x => x.TaskName);
        [Display(Name = "_Model._CollectTask._TargetDeviceType")]
        public ExcelPropety TargetDeviceType_Excel = ExcelPropety.CreateProperty<CollectTask>(x => x.TargetDeviceType);
        [Display(Name = "_Model._CollectTask._Device")]
        public ExcelPropety Device_Excel = ExcelPropety.CreateProperty<CollectTask>(x => x.DeviceId);
        [Display(Name = "_Model._CollectTask._IntervalMinutes")]
        public ExcelPropety IntervalMinutes_Excel = ExcelPropety.CreateProperty<CollectTask>(x => x.IntervalMinutes);
        [Display(Name = "_Model._CollectTask._StartTime")]
        public ExcelPropety StartTime_Excel = ExcelPropety.CreateProperty<CollectTask>(x => x.StartTime, true);
        [Display(Name = "_Model._CollectTask._EndTime")]
        public ExcelPropety EndTime_Excel = ExcelPropety.CreateProperty<CollectTask>(x => x.EndTime, true);
        [Display(Name = "_Model._CollectTask._Status")]
        public ExcelPropety Status_Excel = ExcelPropety.CreateProperty<CollectTask>(x => x.Status);
        [Display(Name = "_Model._CollectTask._CreateTime")]
        public ExcelPropety CreateTime_Excel = ExcelPropety.CreateProperty<CollectTask>(x => x.CreateTime, true);
        [Display(Name = "_Model._CollectTask._UpdateTime")]
        public ExcelPropety UpdateTime_Excel = ExcelPropety.CreateProperty<CollectTask>(x => x.UpdateTime, true);
        [Display(Name = "_Model._CollectTask._CreateBy")]
        public ExcelPropety CreateBy_Excel = ExcelPropety.CreateProperty<CollectTask>(x => x.CreateBy);
        [Display(Name = "_Model._CollectTask._UpdateBy")]
        public ExcelPropety UpdateBy_Excel = ExcelPropety.CreateProperty<CollectTask>(x => x.UpdateBy);
        [Display(Name = "_Model._CollectTask._IsValid")]
        public ExcelPropety IsValid_Excel = ExcelPropety.CreateProperty<CollectTask>(x => x.IsValid);
        [Display(Name = "_Model._CollectTask._TenantCode")]
        public ExcelPropety TenantCode_Excel = ExcelPropety.CreateProperty<CollectTask>(x => x.TenantCode);

	    protected override void InitVM()
        {
            
            Device_Excel.DataType = ColumnDataType.ComboBox;
            Device_Excel.ListItems = DC.Set<MeterDevice>().GetSelectListItems(Wtm, y => y.DeviceCode.ToString());

        }

    }

    public class CollectTaskImportVM : BaseImportVM<CollectTaskTemplateVM, CollectTask>
    {
            //import

    }

}